import 'package:gm_login_plugin/gm_login_plugin.dart';
import 'package:riki_login/pages/user/user_login_management/src/user_login_weichat_auth.dart';

class LoginThirdAuth {
  static initThirdSDK() {
    // 监听授权点击事件
    GMLoginPlugin.addAuthEventListener(
      (platformChannel, method, arguments) async {
        // 微信授权
        if (platformChannel == GMESurpportPlatform.wechart) {
          await LoginWeichatAuth.isInstalled();
          return await LoginWeichatAuth.sendWeiChatAuth();
        }
        // // qq授权
        // else if (platformChannel == GMESurpportPlatform.qq) {
        //   await LoginQQAuth.isInstalled();
        //   return await LoginQQAuth.sendQQAuth();
        // }
        return Future.value();
      },
    );

    // 初始化三方sdk
    LoginWeichatAuth.initWeiChatSDK();
    // LoginQQAuth.initQQSDK();
  }
}
